package scalaLearning.part4

object PartialFunc1 {
  def main(args: Array[String]): Unit = {
    //思路一：map+filter
    val list1 = List(1, 2, 3, 4, "abc")
    //思路二：模式匹配
    val list2 = list1.map(addOne)
    println("list2=" + list2)
  }

  def addOne(n: Any): Any = {
    n match {
      case x: Int => x + 1
      case _ =>
    }
  }

  //
}
